<?php
$counter = new class_counter();
$tintuc = new class_tintuc();

//cap nhat counter
$counter->update_counter();

//cap nhat so nguoi online
$counter->update_whos_online();

//counter
$str_htm = ereg_replace("<!--counter_online-->", $counter->Total_Online()."", $str_htm);
$str_htm = ereg_replace("<!--counter_total-->", $counter->Total_Count()."", $str_htm);

//Tim kiem
$str_htm = ereg_replace("@tukhoa@","$session_tukhoa",$str_htm);
$str_htm = ereg_replace("@giatu@","$session_giatu",$str_htm);
$str_htm = ereg_replace("@giaden@","$session_giaden",$str_htm);


$str_htm = ereg_replace("@form_option@", "", $str_htm);	
$str_htm = ereg_replace("@submit_file@", "", $str_htm);	

//nut 
$str_htm = ereg_replace("@nut_chitiet@", $arr_nut[$langid][0]."", $str_htm);
$str_htm = ereg_replace("@nut_dathang@", $arr_nut[$langid][1]."", $str_htm);
$str_htm = ereg_replace("@nut_trove@", $arr_nut[$langid][2]."", $str_htm);
$str_htm = ereg_replace("@nut_muatiep@", $arr_nut[$langid][3]."", $str_htm);
$str_htm = ereg_replace("@nut_dong@", $arr_nut[$langid][4]."", $str_htm);

$str_htm = ereg_replace("@langid@", "$langid", $str_htm);	
$str_htm = ereg_replace("@catid@", "$catid", $str_htm);
$str_htm = ereg_replace("@subcatid@", "$subcatid", $str_htm);


//sajax begin ======================
//sajax_init();
//$sajax_debug_mode = 1; //debug

sajax_export("list_diadiem");
$sajax_function = loadHtml("../htmls_header/tmp_header_dangtin.htm","");

// begin sajax =====================
sajax_handle_client_request();
$sajax_js = sajax_get_javascript();
$str_htm = ereg_replace("\/\/@sajax_js@", "$sajax_js", $str_htm);
$str_htm = ereg_replace("<!--@sajax_function@-->", $sajax_function, $str_htm);
//sajax end =======================


?>